package com.lanxin.bean;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
 *  短消息
 */
@Entity
@Table(name = "xx_duanxiaoxi")
public class XxDuanxiaoxi {

	@Id
	@GeneratedValue(strategy = IDENTITY)
  private Integer oid;
  private String biaoti; // 标题
  private String neirong; // 内容
  private Integer creator; // 发送人
  private Date createDate; // 发送日期
  private String files; // 附件


    //一对多
    @OneToMany(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
    @JoinColumn(name="xiaoxiid")
    private Set<XxXiaoxijieshou> xiaoxijieshou = new HashSet<>();

    //多对一
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="creator",insertable = false,updatable = false)
    private ZzEmployee emp;

    public Set<XxXiaoxijieshou> getXiaoxijieshou() {
        return xiaoxijieshou;
    }

    public void setXiaoxijieshou(Set<XxXiaoxijieshou> xiaoxijieshou) {
        this.xiaoxijieshou = xiaoxijieshou;
    }

    public ZzEmployee getEmp() {
        return emp;
    }

    public void setEmp(ZzEmployee emp) {
        this.emp = emp;
    }

    public Integer getOid() {
    return oid;
  }

  public void setOid(Integer oid) {
    this.oid = oid;
  }


  public String getBiaoti() {
    return biaoti;
  }

  public void setBiaoti(String biaoti) {
    this.biaoti = biaoti;
  }


  public String getNeirong() {
    return neirong;
  }

  public void setNeirong(String neirong) {
    this.neirong = neirong;
  }


  public Integer getCreator() {
    return creator;
  }

  public void setCreator(Integer creator) {
    this.creator = creator;
  }



  public Date getCreateDate() {
	return createDate;
}

public void setCreateDate(Date createDate) {
	this.createDate = createDate;
}

  public String getFiles() {
    return files;
  }

  public void setFiles(String files) {
    this.files = files;
  }

}
